home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / instan1a / client.frm (.txt) next >
Encoding:
Visual Basic Form  |  1999-10-01  |  3.5 KB  |  123 lines

  1. VERSION 4.00
  2. Begin VB.Form Client 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Net Hood Instant Message"
  5.    ClientHeight    =   4905
  6.    ClientLeft      =   1530
  7.    ClientTop       =   1515
  8.    ClientWidth     =   4095
  9.    Height          =   5340
  10.    Icon            =   "Client.frx":0000
  11.    Left            =   1470
  12.    LinkTopic       =   "Client"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   4905
  16.    ScaleWidth      =   4095
  17.    Top             =   1140
  18.    Width           =   4215
  19.    WindowState     =   1  'Minimized
  20.    Begin VB.Timer Timer1 
  21.       Interval        =   3000
  22.       Left            =   1305
  23.       Top             =   4485
  24.    End
  25.    Begin VB.CommandButton Command2 
  26.       Caption         =   "End"
  27.       Height          =   345
  28.       Left            =   0
  29.       TabIndex        =   3
  30.       Top             =   4560
  31.       Width           =   1035
  32.    End
  33.    Begin VB.CommandButton Command1 
  34.       Caption         =   "Send"
  35.       Height          =   345
  36.       Left            =   2925
  37.       TabIndex        =   2
  38.       Top             =   4560
  39.       Width           =   1170
  40.    End
  41.    Begin VB.TextBox txtSent 
  42.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  43.          Name            =   "MS Sans Serif"
  44.          Size            =   12
  45.          Charset         =   0
  46.          Weight          =   700
  47.          Underline       =   0   'False
  48.          Italic          =   0   'False
  49.          Strikethrough   =   0   'False
  50.       EndProperty
  51.       ForeColor       =   &H00FF0000&
  52.       Height          =   2310
  53.       Left            =   -15
  54.       MultiLine       =   -1  'True
  55.       TabIndex        =   1
  56.       Top             =   0
  57.       Width           =   4110
  58.    End
  59.    Begin VB.TextBox txtMessage 
  60.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  61.          Name            =   "MS Sans Serif"
  62.          Size            =   12
  63.          Charset         =   0
  64.          Weight          =   700
  65.          Underline       =   0   'False
  66.          Italic          =   0   'False
  67.          Strikethrough   =   0   'False
  68.       EndProperty
  69.       ForeColor       =   &H000000FF&
  70.       Height          =   2145
  71.       Left            =   -15
  72.       MultiLine       =   -1  'True
  73.       TabIndex        =   0
  74.       Top             =   2340
  75.       Width           =   4110
  76.    End
  77. Attribute VB_Name = "Client"
  78. Attribute VB_Creatable = False
  79. Attribute VB_Exposed = False
  80. Option Explicit
  81. 'Put the path to your network server here!!!
  82. 'Something like \\Computer Name\C drive\
  83. Const fServe =  NetServerPath & "Sent.txt"
  84. Const fClient = NetSeverPath & "Message.txt"
  85. Private Sub Send()
  86. Dim fnum As Integer
  87. fnum = FreeFile
  88. Open fClient For Output As fnum
  89. Print #fnum, txtMessage
  90. Close fnum
  91. End Sub
  92. Private Sub LoadData()
  93. Dim fnum As Integer
  94. fnum = FreeFile
  95. Open fServe For Input As fnum
  96. txtSent = Input(LOF(fnum), fnum)
  97. Close fnum
  98. End Sub
  99. Private Sub Command1_Click()
  100. txtMessage = ""
  101. End Sub
  102. Private Sub Command2_Click()
  103. If FileExists(fServe) Then Kill fServe
  104. If FileExists(fClient) Then Kill fClient
  105. End Sub
  106. Private Sub Form_Load()
  107. TopZ Me
  108. End Sub
  109. Private Sub Form_Unload(Cancel As Integer)
  110. Cancel = True
  111. Window Me, 2
  112. If FileExists(fServe) Then Kill fServe
  113. If FileExists(fClient) Then Kill fClient
  114. txtSent = ""
  115. End Sub
  116. Private Sub Timer1_Timer()
  117. If FileExists(fServe) Then
  118. LoadData
  119. Window Me, 1
  120. TopZ Me
  121. End If
  122. End Sub
  123.